package com.ffcs.crmd.tsp.task.job.impl.test;

import java.util.concurrent.atomic.AtomicLong;

import com.ffcs.crmd.tsp.api.dto.task.TspJobExecutionException;
import com.ffcs.crmd.tsp.api.task.job.IJob;
import com.ffcs.crmd.tsp.api.task.job.IJobExecutionContext;

public class SimpleJobWaitingImpl implements IJob<String> {
    
    private static AtomicLong index = new AtomicLong();
    
    @Override
    public void execute(IJobExecutionContext<String> context) throws TspJobExecutionException {
        System.out.println(context.getTspJobInstance().getJobKey() + " --- count" + index.incrementAndGet());
        try {
            Thread.sleep(60 * 60 * 1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
